package com.joysuch.wwyt.attendance.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author ZhaoQiuWei
 * @Date 2022/3/4 10:02
 */
public enum AttendanceFlagEnum {

    FIXED(0,"固定制考勤"),

    PERIOD(1,"排班制考勤"),

    CUSTOMIZE(2,"自定义考勤"),

    EXCEL(3,"excel导入");

    private Integer value;

    private String desc;

    AttendanceFlagEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public final Integer getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    private static final Map<Integer, AttendanceFlagEnum> lookup = new HashMap<>();

    static {
        for (AttendanceFlagEnum e : EnumSet.allOf(AttendanceFlagEnum.class)) {
            lookup.put(e.value, e);
        }
    }

    public static AttendanceFlagEnum find(Integer value) {
        return lookup.get(value);
    }
}
